UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ewWltl9uqAr4lgJe1yw2X6TlpBvA5SMtjbJ1ZFc8yU='
WHERE
key_id = '68b27ee1ce67a189d4f64a1f09715104ed4bc25db9927a1b6a3023fccb477aca'
AND (
token = '4ewWltl9uqAr4lgJe1yw2X6TlpBvA5SMtjbJ1ZFc8yU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)