UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ECvUlGHeaGONdGJ60o5O+hk6AJWylA3aufB3ABlO+8M='
WHERE
key_id = '954153120370b3fe9e10e627d526ca4b027ebe39d066c52986f3fc2156b14af2'
AND (
token = 'ECvUlGHeaGONdGJ60o5O+hk6AJWylA3aufB3ABlO+8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)