UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SrUHq2nh6evPLzoK9+cguk0zGBfKwLn1w0++P7AG6cU='
WHERE
key_id = '2ccb1fc45823282da118a09861bb2743c8861e060258c10cff75931a6fc3a298'
AND (
token = 'SrUHq2nh6evPLzoK9+cguk0zGBfKwLn1w0++P7AG6cU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)