UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GjgnsUwMDyCgUF+6Jg8kHXVoyqYZmDsk2GurPmmByEU='
WHERE
key_id = '8b27c2b9a02305f7c6826bc5931ec4d9835db70734ec5881be3fc06071d87c77'
AND (
token = 'GjgnsUwMDyCgUF+6Jg8kHXVoyqYZmDsk2GurPmmByEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)