UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z2qs8hGb9xrF5iaDih/rCM87kUiM2uxPvLV+kThNv20='
WHERE
key_id = 'dd9f6e6f92072d18897ac827f534cfc16e5e27b2924c858d9a31e285cab5afc5'
AND (
token = 'Z2qs8hGb9xrF5iaDih/rCM87kUiM2uxPvLV+kThNv20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)