UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rz+AD2RZiw3p7jVykyqVPlW3whrJkuHm0a6ADkfrJk0='
WHERE
key_id = '0b11aa488d30153d0de3f4acdd9b205d4c519bc6b900af10c919a614c1c79305'
AND (
token = 'rz+AD2RZiw3p7jVykyqVPlW3whrJkuHm0a6ADkfrJk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)