UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o2i/h3vWLCiZdEosetc1jYC6q8xtB2JmvyFyh97Xwd8='
WHERE
key_id = '2d4ce6708a1c80ee468eb820ab9ae10e33ab5684ed0e82559aec1ac31279fe4f'
AND (
token = 'o2i/h3vWLCiZdEosetc1jYC6q8xtB2JmvyFyh97Xwd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)