UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WymJJBXp2G29tj21LbW0irkFuZufA0CHHnw04AcdE8='
WHERE
key_id = '6f33cda64824b9f0277d781ed3cb699a51d766f4e8d4e5d45966003e51725820'
AND (
token = '2WymJJBXp2G29tj21LbW0irkFuZufA0CHHnw04AcdE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)