UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v+w46yIM1UMPiPPKeGtPrvKyINRIQO46AwQ7r8Xkcuo='
WHERE
key_id = 'acd1458012d21c3fef2f4b7340ee73d758ea2b651acd5895e25bfeecc976369d'
AND (
token = 'v+w46yIM1UMPiPPKeGtPrvKyINRIQO46AwQ7r8Xkcuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)