UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3kMiR7VPgiE60E8/3G9EzHcTgyXnHFtOrkPiodVF32s=' 
WHERE 
  key_id = 'e1a3a7378141738a4bebc7a4c9d2aa1457145e212422cadae07ea176cc0b9d6d' 
  AND (
    token = '3kMiR7VPgiE60E8/3G9EzHcTgyXnHFtOrkPiodVF32s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029