UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YaqRaLoTNo1ucDi18rhlA7kNbjb+WCDARjMHNWnNL6k='
WHERE
key_id = '49ed75f29a64c73f83a7dcefcf2c5f00eb045d559e51d0b3e10902da78e926e6'
AND (
token = 'YaqRaLoTNo1ucDi18rhlA7kNbjb+WCDARjMHNWnNL6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)