UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/CWqDF6EvYZl35tcZwuJCcmIXcbjIWsdIhdha5CIgs='
WHERE
key_id = '4a2fe0adac8858fc76e31092be00b899ae881ba00af4dcbc8948ab2d96e34c7a'
AND (
token = 'Q/CWqDF6EvYZl35tcZwuJCcmIXcbjIWsdIhdha5CIgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)