UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lBFrK4MC5GFyFpx4lXqxLdd5LgINiTMJB8tGhrnMK0Y='
WHERE
key_id = '18cdb89612a95f2aa44d7403bef38ce06cac09adb555c5ee05931274f7af8200'
AND (
token = 'lBFrK4MC5GFyFpx4lXqxLdd5LgINiTMJB8tGhrnMK0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)