UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tI6nwa/3LwCKlfRDFEKYNWwWxMY7CMXgSFn6k9YDr7Q='
WHERE
key_id = 'bfbbb090aa33c5a0bb9fa8ce55d32cee5d21239119d8b25d4e9d32537f48281d'
AND (
token = 'tI6nwa/3LwCKlfRDFEKYNWwWxMY7CMXgSFn6k9YDr7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)