UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zlDFST9oJYek10KuJzRq4oCLS5YvjaPMiArIclqw8PI='
WHERE
key_id = '93a2d9574917debfcd0e0a04dce5d18b9f89909492908800d7e8fb1d904efa2e'
AND (
token = 'zlDFST9oJYek10KuJzRq4oCLS5YvjaPMiArIclqw8PI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)