UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vDmlVvdQplUPe5xDG/4WpfS3Uhj840WnXsMIpKZIlcM='
WHERE
key_id = 'df7976c9ff7e97d1c335a562c8461d34796ccc1e3cbfa486facd99d2ff15f366'
AND (
token = 'vDmlVvdQplUPe5xDG/4WpfS3Uhj840WnXsMIpKZIlcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)