UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3J+2brXVaAOAEMc5zSuYk5wDmXvxwpek2pqiv652K04='
WHERE
key_id = '8ca1eda84846393aae242baa4b4963a79f923d6551b7ec2cdf1c59c594821cd3'
AND (
token = '3J+2brXVaAOAEMc5zSuYk5wDmXvxwpek2pqiv652K04='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)