UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9sW6xzyZlWjV1Khy3KCvRp/UgHw8cchOMmjlT/Dhx94='
WHERE
key_id = '122b5e0b54ebaefcb7698b74a1adcf7908a7f56efe3d65061ce83d3113f88182'
AND (
token = '9sW6xzyZlWjV1Khy3KCvRp/UgHw8cchOMmjlT/Dhx94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)