UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9kRUDWUsH10/83hvVTi6trGdTQl93giqLaWPwrTW0Tk='
WHERE
key_id = 'df02a4cbdb781015b660c0c03a9f7f0a37b317c93e18217559e47498d8f1a1e4'
AND (
token = '9kRUDWUsH10/83hvVTi6trGdTQl93giqLaWPwrTW0Tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)