UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '94DYxP9Y4+vaTALAUqFG3lGP6VTAENwfbLHJoBGKGT0='
WHERE
key_id = 'b5a3572544e2874596e4ca2f65cdf2b1b47d52ea5d75bec3d36a8caf8022e0d3'
AND (
token = '94DYxP9Y4+vaTALAUqFG3lGP6VTAENwfbLHJoBGKGT0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)