UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VSxPiyVkASTJWsXwgHuHingxq7ZCrBUTFcNDskEmFuQ='
WHERE
key_id = '42e62c5fe970b17f0c9aa00562301cef2afd93891fcc9958c10183c6f59c9ef6'
AND (
token = 'VSxPiyVkASTJWsXwgHuHingxq7ZCrBUTFcNDskEmFuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)