UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jORScoQ4VvwGkcpdRg+9k0UUqst2YG81Bu5u6j3F4Sg='
WHERE
key_id = 'c57560961ba5fab0ddf8e97fddcceb8aa32d7e35a901f1a4311f38545af644b9'
AND (
token = 'jORScoQ4VvwGkcpdRg+9k0UUqst2YG81Bu5u6j3F4Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)