UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Iq/bmf1FAd5sbg0KbnZXA9V8EGHA/UhwqTb3zj4gCO0='
WHERE
key_id = '9fc80021e1d391841df7fe8fec7cae39f4b0048aaccb10f672835c7c819eb54c'
AND (
token = 'Iq/bmf1FAd5sbg0KbnZXA9V8EGHA/UhwqTb3zj4gCO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)