UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9vXMaLrOmRh2WanqORIf7VW5XIdz3f3QL8O9VLoSuEE='
WHERE
key_id = '1000b4794d1730d9dcf859a5e319a16821d241885da8de60ab7da295522b7b1f'
AND (
token = '9vXMaLrOmRh2WanqORIf7VW5XIdz3f3QL8O9VLoSuEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)