UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qvauBBOj2vsD+IP4usxxbDubhoum3nvRrxABxSGuqII='
WHERE
key_id = 'c6b7571b72819e5bec337a5d5fee9eaebcdc995c35341129b3099beebe628525'
AND (
token = 'qvauBBOj2vsD+IP4usxxbDubhoum3nvRrxABxSGuqII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)