UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5slT+Rg6tB4D5e1sMK5reYs8mNtcsVb4yDR9joOE4Q='
WHERE
key_id = '9b69c930730d59e022938ca1bf936963b9aaf346eb41d0c57abd040a65ec8b7e'
AND (
token = 'G5slT+Rg6tB4D5e1sMK5reYs8mNtcsVb4yDR9joOE4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)