UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Q6onz47mPNFkcF+H0nYVpf1JdxXkSTFQAUJjbHIVy4='
WHERE
key_id = '76081c94cd9c2ac94514bf0ae39db352e0ad30740d297d522422e7b8a3ba47cb'
AND (
token = '3Q6onz47mPNFkcF+H0nYVpf1JdxXkSTFQAUJjbHIVy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)