UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CTIJtnC1h54FLMFU1bxgyMrQj5O3KhVo1ipyv65ILnQ='
WHERE
key_id = '06548ca2d41a417fc03cbbc9e5c64dfa1a83936db89d7719355ade6ee58f24ad'
AND (
token = 'CTIJtnC1h54FLMFU1bxgyMrQj5O3KhVo1ipyv65ILnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)