UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lG5FNZdiJnaNPGwqSXVKQPiEusYlye5G4/Pf+JA2sjg=' 
WHERE 
  key_id = 'af7d5d8acbae9292e26e81ed0e99f1b9062b60657b62504bbcd44694f3213c1a' 
  AND (
    token = 'lG5FNZdiJnaNPGwqSXVKQPiEusYlye5G4/Pf+JA2sjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033