UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zlhDpSeU0qR3YEtlDwBQWSXBcXtLbNGPEkMUgXbZmh4='
WHERE
key_id = 'ad7ecc934d77b91b4e65b985aade0d138cf1118807026c3627b0a6dc978951b4'
AND (
token = 'zlhDpSeU0qR3YEtlDwBQWSXBcXtLbNGPEkMUgXbZmh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)