UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyN1a208miOIP6QjDNFScOtFFf4ryyP0PW/mwuvLny0='
WHERE
key_id = 'c07ffcddae57bad0a669a2a4b7e72bfe327c783bcf196073e2d953d364723b7e'
AND (
token = 'yyN1a208miOIP6QjDNFScOtFFf4ryyP0PW/mwuvLny0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)