UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hWUT2re0memu1MMqr4yLedC5aq3BzIVieUo4lYyrpxw='
WHERE
key_id = '66bf81a2dc28e498ccc5b50707f017f2a45ddb5886e3947a302f2dae3ee37eaf'
AND (
token = 'hWUT2re0memu1MMqr4yLedC5aq3BzIVieUo4lYyrpxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)