UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ms8VvDolVb4ubFdKE74hY2OzDPowklrNkVsorOXw/JU='
WHERE
key_id = 'b28feb5f2a6d786ab011c7ea0af9a0d22baec118fa5a7a93e76f77bf3739953c'
AND (
token = 'ms8VvDolVb4ubFdKE74hY2OzDPowklrNkVsorOXw/JU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)