UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42kM/Cm419z1i42UCHmzhAcSVxFeBMus5c9k2me45mg='
WHERE
key_id = 'ffa3527e9efdfbb93b0e449fb06d0342bc0046d0bc64993cda95b60513348dc7'
AND (
token = '42kM/Cm419z1i42UCHmzhAcSVxFeBMus5c9k2me45mg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)