UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7FY8sxSBq/KSQ3PsepM++tAAuymmP3fPYICYcZemrEM='
WHERE
key_id = '909a87054c40910278cdcdabdb52a5f87dd39e0e122912cc6ed00112351167f6'
AND (
token = '7FY8sxSBq/KSQ3PsepM++tAAuymmP3fPYICYcZemrEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)