UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FxMQ6WVOYi+acLOpCpznTPdXGTZe/fRp/b6+tUeBlWI='
WHERE
key_id = '1d84effb278370c94c0e370d96486493619be9b7ffc236bdd41464d125d91d13'
AND (
token = 'FxMQ6WVOYi+acLOpCpznTPdXGTZe/fRp/b6+tUeBlWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)