UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DUlIqF+RYZnzvoLhHhsG4keVvbOlOyN3CHOaLDDDJNs=' 
WHERE 
  key_id = 'bdff729dd0be32796761a152b38b4067fb6a135e225f6deaccc26c1175af1d48' 
  AND (
    token = 'DUlIqF+RYZnzvoLhHhsG4keVvbOlOyN3CHOaLDDDJNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034