UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ph9H0lR9aViK/6kBp4L4WscyWAWGfYKr3JZ2yhs9+I=' 
WHERE 
  key_id = '1c86d6d4bad65a70c739c0a9b12111e3f5acf7d2821363ed5bf8b714baa01b59' 
  AND (
    token = '2ph9H0lR9aViK/6kBp4L4WscyWAWGfYKr3JZ2yhs9+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025