UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L2VT1vCF4jc7D+8DCbIoDLJZXi1LhQ9XTa440cJbytE=' 
WHERE 
  key_id = 'b1f26f32bd864e90eb3cd479a7d95a18abce7a8cad7344470c1adc0098d24a9b' 
  AND (
    token = 'L2VT1vCF4jc7D+8DCbIoDLJZXi1LhQ9XTa440cJbytE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030